﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="HeTong_GongYePin_MaiMai_SheZhi.aspx.cs" Inherits="syc.Sale.HeTong_GongYePin_MaiMai_SheZhi" %>

<head id="Head1" runat="server">
    <title>
     
    </title>
    
</head>
<body>
<script type="text/javascript" language="javascript" src="/common.js"></script>
    <form id="form1" runat="server">
    <div>
      <div id="wintop" class="wintop">工业品买卖合同</div>
        <asp:Panel ID="Panel0" runat="server" CssClass="panel">
        <asp:Button ID="Button_Finish" runat="server" Text="保 存" CssClass="button" 
                UseSubmitBehavior="False" onclick="Button_Finish_Click" />  
         <input id="Button" type="button" value="返回"  
             onclick="document.location.href='HeTong_YuanLiao_Search.aspx'" class="button" />     
        </asp:Panel>
        <asp:Panel ID="Panel1" runat="server" CssClass="panel"> 
        <table>
        <tr><td>
         供货方：</td><td>  
            <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                ConnectionString="<%$ ConnectionStrings:SCMConnectionString1 %>" 
                SelectCommand="SELECT [ID], [名称] FROM [原料供货单位]"></asp:SqlDataSource>
                <asp:DropDownList ID="GongHuoFang" runat="server" DataSourceID="SqlDataSource1" 
                    DataTextField="名称" DataValueField="ID">
                </asp:DropDownList>
            </td></tr>
            <tr><td>合同编号：</td><td>
                <asp:TextBox ID="HeTongHao" runat="server" Width="110px" CssClass="intxt1"></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                    ControlToValidate="HeTongHao" ErrorMessage="*请输入合同编号"></asp:RequiredFieldValidator>
                </td></tr>
            <tr><td>签订日期：</td><td><span lang="zh-cn">
                <asp:TextBox ID="RiQi" runat="server" CssClass="intxt1" Width="110px"></asp:TextBox>
                <img align="middle" alt="" 
                    onclick="makecalendar(document.getElementById('RiQi').value, document.getElementById('RiQi'));" 
                    src="/Icons/29.png" /></span><asp:RequiredFieldValidator 
                    ID="RequiredFieldValidator2" runat="server" ControlToValidate="RiQi" 
                    ErrorMessage="*请选择签订日期"></asp:RequiredFieldValidator>
                </td></tr>
            </table>
            标的、数量、价款及交(提)货时间设置： 
            <table border="1" bordercolor="black" cellpadding="1" cellspacing="0">
                <tr>
                    <td align="center">
                        产品名称 
                    </td>
                    <td align="center">
                        规格型号 
                    </td>
                    <td align="center">
                        数量 
                    </td>
                    <td align="center">
                        单位 
                    </td>
                    <td align="center">
                        单价(元/吨)
                    </td>                   
                    <td align="center">
                        长度(米)
                    </td>
                    <td align="center">
                        交货时间 
                    </td>
                    <td align="center">
                        交货数量(吨)
                    </td>
                </tr>
                <tr>
                    <td align="center">
                        <asp:TextBox ID="R1_C1" runat="server" CssClass="blank_center" ReadOnly="True" 
                            Text="" Width="80"></asp:TextBox>
                    </td>
                    <td align="center">
                        <asp:TextBox ID="R1_C2" runat="server" CssClass="blank_center" ReadOnly="True" 
                            Text="" Width="80"></asp:TextBox>
                    </td>
                    <td>
                        <asp:TextBox ID="R1_C3" runat="server" CssClass="blank_center" ReadOnly="True" 
                            Text="" Width="80" onKeyPress="if (event.keyCode!=46 && event.keyCode!=45 && (event.keyCode<48 || event.keyCode>57)) event.returnValue=false"> </asp:TextBox>
                    </td>
                    <td align="center">
                        <asp:TextBox ID="R1_C4" runat="server" CssClass="blank_center" ReadOnly="True" 
                            Text="" Width="80"> </asp:TextBox>
                    </td>
                    <td align="center">
                        <asp:TextBox ID="R1_C5" runat="server" CssClass="blank_center" ReadOnly="True" 
                            Text="" Width="80" onKeyPress="if (event.keyCode!=46 && event.keyCode!=45 && (event.keyCode<48 || event.keyCode>57)) event.returnValue=false"></asp:TextBox>
                    </td>                    
                    <td align="center">
                        <asp:TextBox ID="R1_C7" runat="server" CssClass="blank_center" ReadOnly="True" 
                            Text="" Width="80" onKeyPress="if (event.keyCode!=46 && event.keyCode!=45 && (event.keyCode<48 || event.keyCode>57)) event.returnValue=false"></asp:TextBox>
                    </td>
                    <td align="center">
                         <asp:TextBox ID="R1_C9" runat="server" CssClass="blank_center"  Width="100"
                             Height="22px"  Font-Size="13px"
                        
                             onclick="makecalendar(document.getElementById('R1_C9').value, document.getElementById('R1_C9'));" 
                             Enabled="false" ></asp:TextBox>
                    </td>
                    <td align="center">
                        <asp:TextBox ID="R1_C8" runat="server" CssClass="blank_center" ReadOnly="True" 
                            Text="" Width="90" onKeyPress="if (event.keyCode!=46 && event.keyCode!=45 && (event.keyCode<48 || event.keyCode>57)) event.returnValue=false"></asp:TextBox>
                    </td>
                    <td align="center">
                        <asp:Button ID="Button_Add1" runat="server" CommandArgument="1" 
                            CssClass="smallbutton" oncommand="Button_Add_Command" Text="添 加" 
                            UseSubmitBehavior="False" />
                    </td>
                </tr>
         <!--       <tr>
                    <td align="center">
                        <asp:TextBox ID="R2_C1" runat="server" CssClass="blank_center" ReadOnly="True" 
                            Text="" Width="80"></asp:TextBox>
                    </td>
                    <td align="center">
                        <asp:TextBox ID="R2_C2" runat="server" CssClass="blank_center" ReadOnly="True" 
                            Text="" Width="80"></asp:TextBox>
                    </td>
                    <td>
                        <asp:TextBox ID="R2_C3" runat="server" CssClass="blank_center" ReadOnly="True" 
                            Text="" Width="80"> </asp:TextBox>
                    </td>
                    <td align="center">
                        <asp:TextBox ID="R2_C4" runat="server" CssClass="blank_center" ReadOnly="True" 
                            Text="" Width="80"> </asp:TextBox>
                    </td>
                    <td align="center">
                        <asp:TextBox ID="R2_C5" runat="server" CssClass="blank_center" ReadOnly="True" 
                            Text="" Width="80"></asp:TextBox>
                    </td>
                    <td align="center">
                        <asp:TextBox ID="R2_C6" runat="server" CssClass="blank_center" ReadOnly="True" 
                            Text="" Width="80"></asp:TextBox>
                    </td>
                    <td align="center">
                        <asp:TextBox ID="R2_C7" runat="server" CssClass="blank_center" ReadOnly="True" 
                            Text="" Width="80"></asp:TextBox>
                    </td>
                    <td align="center">
                        <asp:DropDownList ID="DropDownList2" runat="server" Visible="False">
                            <asp:ListItem Value="1">1个月</asp:ListItem>
                            <asp:ListItem Value="2">2个月</asp:ListItem>
                            <asp:ListItem Value="3">3个月</asp:ListItem>
                            <asp:ListItem Value="4">4个月</asp:ListItem>
                            <asp:ListItem Value="5">5个月</asp:ListItem>
                            <asp:ListItem Value="6">6个月</asp:ListItem>
                            <asp:ListItem Value="7">7个月</asp:ListItem>
                            <asp:ListItem Value="8">8个月</asp:ListItem>
                            <asp:ListItem Value="9">9个月</asp:ListItem>
                            <asp:ListItem Value="10">10个月</asp:ListItem>
                            <asp:ListItem Value="11">11个月</asp:ListItem>
                            <asp:ListItem Value="12">12个月</asp:ListItem>
                        </asp:DropDownList>
                    </td>
                    <td align="center">
                        <asp:TextBox ID="R2_C8" runat="server" CssClass="blank_center" ReadOnly="True" 
                            Text="" Width="90"></asp:TextBox>
                    </td>
                    <td align="center">
                        <asp:Button ID="Button_Add2" runat="server" CommandArgument="2" 
                            CssClass="smallbutton" oncommand="Button_Add_Command" Text="添 加" 
                            UseSubmitBehavior="False" />
                    </td>
                </tr>
                -->
            </table>          
        </asp:Panel>
        <asp:Panel ID="Panel2" runat="server" CssClass="panel2">
            <asp:Label ID="Message" runat="server" Text="·准备就绪" CssClass="prompt"></asp:Label>
        </asp:Panel>

    </div>
     <asp:Panel ID="Panel_Grid" runat="server" Visible="False">
        <iframe id="gridback" 
                     style="left:133px; top:170px;position:absolute;width:0px;height:0px;z-index: 1; right: 510px;"></iframe>
        <div id="gridframe" class="gridframe" style="left:125px;top:170px;width:650px;">
        
            <div class="gridview">
                <table border="1" width="100%" cellspacing="0" cellpadding="0" 
                    bordercolor="#d0d0d0">
	                <tr>
		                <td class="grid-title">
                            <asp:ImageButton ID="ImageButton_Cancel" 
                                ImageUrl="~/Icons/cancel.gif" AlternateText="关闭" ImageAlign="Right" 
                                runat="server" onclick="ImageButton_Cancel_Click" />
                        </td>
		            </tr>
		            <tr>
		                <td class="grid-back">
                           <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
                                ConnectionString="<%$ ConnectionStrings:SCMConnectionString1 %>" 
                                SelectCommand="SELECT * FROM [原料]"></asp:SqlDataSource>
                            <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
                                AutoGenerateColumns="False" CssClass="grid" DataKeyNames="ID" 
                                DataSourceID="SqlDataSource2" 
                                GridLines="None" ondatabound="GridView1_DataBound" 
                                onpageindexchanged="GridView1_PageIndexChanged" AllowSorting="True" 
                                UseAccessibleHeader="False" PageSize="10">
                                <PagerSettings Visible="False" />
                                <RowStyle CssClass="grid-row-normal" />
                                <Columns>
                                    <asp:BoundField DataField="ID" HeaderText="ID" InsertVisible="False"  
                                        ItemStyle-CssClass="grid" HeaderStyle-CssClass="grid-header"
                                        ReadOnly="True" SortExpression="ID" ItemStyle-Width="80" 
                                        ItemStyle-HorizontalAlign="Center" >
    <HeaderStyle CssClass="grid-header"></HeaderStyle>

    <ItemStyle HorizontalAlign="Center" CssClass="grid" Width="80px"></ItemStyle>
                                    </asp:BoundField>
                                    <asp:BoundField DataField="品名" HeaderText="品名" SortExpression="品名" 
                                        ItemStyle-CssClass="grid" HeaderStyle-CssClass="grid-header"
                                        ItemStyle-Width="160" >
    <HeaderStyle CssClass="grid-header"></HeaderStyle>

    <ItemStyle CssClass="grid" Width="160px"></ItemStyle>
                                    </asp:BoundField>
                                    <asp:BoundField DataField="钢级" HeaderText="钢级" SortExpression="钢级" 
                                        ItemStyle-CssClass="grid" HeaderStyle-CssClass="grid-header"
                                        ItemStyle-Width="80" ItemStyle-HorizontalAlign="Center">
    <HeaderStyle CssClass="grid-header"></HeaderStyle>

    <ItemStyle CssClass="grid" Width="80px"></ItemStyle>
                                    </asp:BoundField>
                                    <asp:BoundField DataField="规格" HeaderText="规格" SortExpression="规格" 
                                        ItemStyle-CssClass="grid" HeaderStyle-CssClass="grid-header"
                                        ItemStyle-Width="160" >
    <HeaderStyle CssClass="grid-header"></HeaderStyle>

    <ItemStyle CssClass="grid" Width="160px"></ItemStyle>
                                    </asp:BoundField>


                                    <asp:TemplateField HeaderText="操作" ShowHeader="true" ItemStyle-CssClass="grid" 
                                        HeaderStyle-CssClass="grid-header" ItemStyle-Width="60" 
                                        ItemStyle-HorizontalAlign="Center">
                                        <ItemTemplate>
                                            <asp:Button ID="Button1" runat="server" CommandArgument='<%# Eval("ID")+"\t"+Eval("品名")+"\t"+Eval("单位")+"\t" +Eval("规格")%>'
                                                Text="选择" CssClass="smallbutton" oncommand="Button1_Command" 
                                               />
                                        </ItemTemplate>

    <HeaderStyle CssClass="grid-header"></HeaderStyle>

    <ItemStyle HorizontalAlign="Center" CssClass="grid" Width="60px"></ItemStyle>
                                    </asp:TemplateField>
                                </Columns>
                              </asp:GridView>
		                </td>
	                </tr>
	                <tr>
		                <td>
		                    <table width="100%">
		                        <tr>
		                            <td class="pagebar">
                                        <asp:Button ID="Button_Pager_First" runat="server" Text="" ToolTip="首页" 
                                            CssClass="pageturn-first-b" onclick="Pager_Click" CommandName="--" />
                                        <asp:Button ID="Button_Pager_Prev" runat="server" Text="" ToolTip="上一页" 
                                            CssClass="pageturn-prev-b" onclick="Pager_Click" CommandName="-" />
                                        <input type="button" class="page-split" />第<asp:TextBox 
                                            ID="TextBox_Pager" runat="server" CssClass="pageturn" 
                                            ontextchanged="Pager_Click"></asp:TextBox>页<input 
                                            type="button" class="page-split" /><asp:Label 
                                            ID="Label_Pages" runat="server"></asp:Label>
                                        <input type="button" class="page-split" />
                                        
                                        <asp:Button ID="Button_Pager_Next" runat="server" Text="" ToolTip="下一页" 
                                            CssClass="pageturn-next-b" onclick="Pager_Click" CommandName="+" />
                                        <asp:Button ID="Button_Pager_Last" runat="server" Text="" ToolTip="末页" 
                                            CssClass="pageturn-last-b" onclick="Pager_Click" CommandName="++" />
                                    </td>
                                    <td align="right">
                                        <asp:Label ID="Label_Total" runat="server" CssClass="grid_totalrows"></asp:Label>
                                    </td>
                                </tr>
                           </table>

		                </td>
	                </tr>
                </table>
                   </div>
        </div>

    <script>
        var gb = document.getElementById("gridback");
        var gf = document.getElementById("gridframe");
        gb.style.width = gf.clientWidth + "px";
        gb.style.height = gf.clientHeight + "px";
        
    </script>
    
    </asp:Panel>
    
    
    </form>
    <script>
        var textboxs = document.getElementsByTagName("input");
        for (var i = 0; i < textboxs.length; i++) {
            if (textboxs[i].className == "pageturn" || textboxs[i].className == "intxt1" || textboxs[i].className == "intxt2") {
                textboxs[i].onfocus = function(e) { this.select(); };
            }
        }
    </script>
</body>
</html>


